package com.agan.aganalgorithm.graph.depthfirst;

import java.util.ArrayList;

/**
 * 有向图的实现 链表
 */
public class LinksGraph {

    ArrayList<ArrayList<Integer>> graphs;

    public LinksGraph(){
    }

    public LinksGraph(int v){
      graphs = new ArrayList<>(v);
      for (int i=0;i<v ; i++){
          graphs.add(new ArrayList<>());
      }
    }

    public void addEdge(int start,int end){
        graphs.get(start).add(end);
    }

    public void removeEdge(int start,int end){
        graphs.get(start).remove((Integer) end);
    }
}
